package com.lagou;

import com.lagou.bean.Resume;
import com.lagou.com.lagou.repository.ResumeRepository;
import com.lagou.dao.ResumeDao;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

import java.util.List;

@SpringBootApplication
public class MongoTemplateMain {
    public static void main(String[] args) {
        ApplicationContext applicationContext = SpringApplication.run(MongoTemplateMain.class,args);
        ResumeRepository resumeRepository = applicationContext.getBean(ResumeRepository.class);
//        for(int i=0;i < 1000;i++){
//            Resume resume = new Resume();
//            resume.setName("test" + i);
//            resume.setExpectSalary(i + 000);
//            resume.setCity("bj");
//            resumeRepository.save(resume);
//        }
        List<Resume> all = resumeRepository.findAll();
        for(Resume resume:all){
            System.out.println(resume);
        }
    }
}
